<div class="bjui-pageHeader">
  <form id="pagerForm" data-toggle="ajaxsearch" action="{:U('index')}" method="post">
    <div class="bjui-searchBar">
      <div class="bjui-searchBar">
        <label>搜索：</label>
        <div role="group" class="btn-group">
          <select name="key" data-toggle="selectpicker">
            <option value="">－关键字类型－</option>
            <option value="name" <?php echo I("key")=="name" ? "selected='true'" : "";?>>－商品名称－</option>
            <option value="sn" <?php echo I("key")=="sn" ? "selected='true'" : "";?>>－商品货号－</option>
          </select>
          <input type="text" name="value" class="form-control" size="15" value="{:I('value')}">
        </div>
         
        <div role="group" class="btn-group">
          <select name="status" data-toggle="selectpicker">
            <option value="">－商品状态－</option>
            <option value= "{$Think.GOODS_DROP_STATUS}" <?php echo I("status")== GOODS_DROP_STATUS? "selected='true'" : "";?> >－下架－</option>
            <option value= "{$Think.GOODS_UP_STATUS}" <?php echo I("status")== GOODS_UP_STATUS? "selected='true'" : "";?> >－上架－</option>
          </select>
        </div>
         
        
         
        <div role="group" class="btn-group">
          <select name="brand_id" data-toggle="selectpicker">
            <option value="">－请选择品牌－</option>
            <?php foreach($brandList as $brand):?>
            <option value="{$brand.brand_id}" <?php echo I("brand_id")==$brand['brand_id'] ? "selected='true'" : "";?>>{$brand.brand_name}</option>
            <?php endforeach;?>
          </select>
        </div>
         
        <div role="group" class="btn-group">
          <select name="category_id" data-toggle="selectpicker">
            <option value="">－请选择分类－</option>
            <?php if($categoryList)foreach($categoryList as $arr):?>
            <option value="{$arr.id}" <?php echo $arr['id']==I('category_id')?'selected':'';?>>{$arr.title_show}</option>
            <?php endforeach;?>
          </select>
        </div>
         
        <div role="group" class="btn-group">
          <select name="attribute_id" data-toggle="selectpicker">
            <option value="">－请选择属性－</option>
            <?php foreach($attributeList as $att):?>
            <option value="{$att.id}" <?php echo $att['id']==I('attribute_id')?'selected':'';?>>{$att.name}</option>
            <?php endforeach;?>
          </select>
          </select>
        </div>
         
        <label>市场价范围：</label>
        <input type="text" name="min_price" class="form-control" size="7" value="{:I('min_price')}">
        <label>至</label>
        <input type="text" name="max_price" class="form-control" size="7" value="{:I('max_price')}">
        &nbsp;
        <label>库存数量：</label>
        <input type="text" name="min_number" class="form-control" size="7" value="{:I('min_number')}">
        <label>至</label>
        <input type="text" name="max_number" class="form-control" size="7" value="{:I('max_number')}">
        <button type="submit" class="btn-default" data-icon="search">查询</button>
          <a class="btn btn-orange" href="javascript:;" onclick="$(this).navtab('reloadForm', true)" data-icon="undo">清空查询</a> &nbsp; 
		  <a <php>echo display(CONTROLLER_NAME.'/add');</php> data-title="添加商品" data-mask="true" data-id="GoodsAdd" data-toggle="navtab" class="btn btn-green" data-icon="plus" href="{:U('add')}">添加</a>
        <div class="pull-right" <php>echo display(CONTROLLER_NAME.'/batchOperation');</php>>
        <div class="btn-group">
          <button type="button" class="btn-default dropdown-toggle" data-toggle="dropdown" data-icon="copy">复选框-批量操作<span class="caret"></span></button>
          <ul class="dropdown-menu right" role="menu">
		  	<li><a href="{:U('batchOperation?method=drop')}" data-toggle="doajaxchecked" data-confirm-msg="确定要删除选中项吗？" data-idname="delids" data-group="ids">批量下架</a></li>
            <li><a href="{:U('batchOperation?method=del')}" data-toggle="doajaxchecked" data-confirm-msg="确定要删除选中项吗？" data-idname="delids" data-group="ids">批量删除</a></li>
          </ul>
        </div>
      </div>
      </div>
    </div>
  </form>
</div>
<div class="bjui-pageContent tableContent">
  <table class="table table-bordered table-hover table-striped table-top">
    <thead>
      <tr>
        <!-- 选择   商品名称    商品品牌    商品分类 属性  市场价   发布时间    库存数量    操作  -->
        <th width="26"><input type="checkbox" class="checkboxCtrl" data-group="ids" data-toggle="icheck"></th>
        <th data-order-field="name">商品名称</th>
        <th data-order-field="brand_id">商品品牌</th>
        <th data-order-field="category_id">商品分类</th>
        <th data-order-field="attribute_id">属性</th>
        <th data-order-field="price">市场价</th>
        <th data-order-field="create_time">生成时间</th>
        <th>库存数量</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      <?php foreach($list as $arr):?>
      <tr>
        <td><input type="checkbox" name="ids" data-toggle="icheck" value="{$arr.id}"></td>
        <!-- 商品名称 -->
        <td>{$arr.name}</td>
        <!-- 商品品牌 -->
        <td>{$arr.brand_name}</td>
        <!-- 商品分类 -->
        <td>{$arr.category_name}</td>
        <!-- 属性 -->
        <td>{$arr.attribute_name}</td>
        <!-- 市场价 -->
        <td>{$arr.price}</td>
        <!-- 生成时间 -->
        <td>{:date('Y-m-d H:i:s', $arr['create_time'])}</td>
        <!-- 库存数量 -->
        <td>{$arr.number}</td>
        <!-- 操作 -->
        <td><a <php>echo display(CONTROLLER_NAME.'/edit');</php> class="btn btn-green" data-toggle="navtab" data-options="{id:'Goods{$arr['id']}', url:'{:U('edit?id='.$arr['id'])}', reloadWarn:'已打开业务页面，确认将重新载入?', title:'{$arr.name}-商品详细'}">编辑</a> 
			<a  <php>echo display(CONTROLLER_NAME.'/del');</php> href="{:U('del?id='.$arr['id'])}" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除该行信息吗？">删除</a> 
			<a  <php>echo display(CONTROLLER_NAME.'/goodsStock');</php> href="{:U('goodsStock?id='.$arr['id'])}" class="btn btn-green"  data-height="400"  data-width="800" data-toggle="dialog" data-id="dialog-normal" data-mask="true" data-title="编辑">库存</a>
		</td>
      </tr>
      <?php endforeach;?>
    </tbody>
  </table>
</div>
<div class="bjui-pageFooter">
  <div class="pages"> <span>每页&nbsp;</span>
    <div class="selectPagesize">
      <select data-toggle="selectpicker" data-toggle-change="changepagesize">
        <option value="{$pageSize}">{$pageSize}</option>
        <option value="{$pageSize*3}">{$pageSize*3}</option>
        <option value="{$pageSize*6}">{$pageSize*6}</option>
        <option value="{$pageSize*12}">{$pageSize*12}</option>
        <option value="{$pageSize*15}">{$pageSize*15}</option>
      </select>
    </div>
    <span>&nbsp;条，共 {$total} 条</span> </div>
  <div class="pagination-box" data-toggle="pagination" data-total="{$total}" data-page-size="{$pageSize}"
         data-page-current="{$pageCurrent}"></div>
</div>
